package com.space.school.controller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "ODILServlet",value = "/ODILServlet")
public class ODILServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        String operate = req.getParameter("operate");
        String product_id=req.getParameter("product_id");
        String order_id=req.getParameter("order_id");
        String product_name=req.getParameter("product_name");

        if(operate.equals("update")){
//            修改操作
            req.setAttribute("order_id",order_id);
            req.setAttribute("product_name",product_name);
            req.getRequestDispatcher("update_order_details_infomation_list.jsp").forward(req, resp);
        }else if(operate.equals("del")){
//            删除操作
        }
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        String action = req.getParameter("action");
        if(action.equals("back")){
            resp.sendRedirect("/O_I_T");
        }else if(action.equals("add")){

        }


    }
}
